package com.jbm.jsm.iface;

import com.jbm.core.iface.IAcross;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by lyh on 2017/11/23.
 */
@Entity
@Table(name = "app_version", schema = "", catalog = "jsm")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
public class AppVersionEntity  extends IAcross {
    private int appVerId;
    private int appId;
    private int majorVer;
    private int minorVer;
    private int revisionVer;
    private int build;
    private String appUrl;
    private Timestamp createDate;
    private int createId;
    private int milestone;

    public AppVersionEntity()
    {
        super();
    }

    public AppVersionEntity(IAcross ia)
    {
        super(ia);
    }

    @Id
    @Column(name = "app_ver_id")
    @GeneratedValue
    public int getAppVerId() {
        return appVerId;
    }

    public void setAppVerId(int appVerId) {
        this.appVerId = appVerId;
    }

    @Basic
    @Column(name = "app_id")
    public int getAppId() {
        return appId;
    }

    public void setAppId(int appId) {
        this.appId = appId;
    }

    @Basic
    @Column(name = "major_ver")
    public int getMajorVer() {
        return majorVer;
    }

    public void setMajorVer(int majorVer) {
        this.majorVer = majorVer;
    }

    @Basic
    @Column(name = "minor_ver")
    public int getMinorVer() {
        return minorVer;
    }

    public void setMinorVer(int minorVer) {
        this.minorVer = minorVer;
    }

    @Basic
    @Column(name = "revision_ver")
    public int getRevisionVer() {
        return revisionVer;
    }

    public void setRevisionVer(int revisionVer) {
        this.revisionVer = revisionVer;
    }

    @Basic
    @Column(name = "build")
    public int getBuild() {
        return build;
    }

    public void setBuild(int build) {
        this.build = build;
    }

    @Basic
    @Column(name = "app_url")
    public String getAppUrl() {
        return appUrl;
    }

    public void setAppUrl(String appUrl) {
        this.appUrl = appUrl;
    }

    @Basic
    @Column(name = "create_date")
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Basic
    @Column(name = "create_id")
    public int getCreateId() {
        return createId;
    }

    public void setCreateId(int createId) {
        this.createId = createId;
    }

    @Basic
    @Column(name = "milestone")
    public int getMilestone() {
        return milestone;
    }

    public void setMilestone(int milestone) {
        this.milestone = milestone;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        AppVersionEntity that = (AppVersionEntity) o;

        if (appId != that.appId) return false;
        if (appVerId != that.appVerId) return false;
        if (build != that.build) return false;
        if (createId != that.createId) return false;
        if (majorVer != that.majorVer) return false;
        if (milestone != that.milestone) return false;
        if (minorVer != that.minorVer) return false;
        if (revisionVer != that.revisionVer) return false;
        if (appUrl != null ? !appUrl.equals(that.appUrl) : that.appUrl != null) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = appVerId;
        result = 31 * result + appId;
        result = 31 * result + majorVer;
        result = 31 * result + minorVer;
        result = 31 * result + revisionVer;
        result = 31 * result + build;
        result = 31 * result + (appUrl != null ? appUrl.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        result = 31 * result + createId;
        result = 31 * result + milestone;
        return result;
    }
}
